package jp.aist.gtrc.plus.scheduler.job;


import java.util.Calendar;

import jp.aist.gtrc.plus.scheduler.status.JobStatus;
import jp.aist.gtrc.plus.scheduler.util.Checker;

import jp.aist.gtrc.plus.scheduler.specific.pbs.status.PBSJobStatus;

/*
 * Check if the job request the profiling property.
 * We use -l other=profiling 
 */ 
public class ProfilingJobChecker extends Checker<JobStatus>{

	public boolean isOK(JobStatus job){

                PBSJobStatus pbsJobStatus = (PBSJobStatus) job;
                String other = pbsJobStatus.getOtherResourceRequests();
		if (other != null) {
                        String[] others = other.split(":");
                        for (int i=0; i < others.length; i++) {
                           if (others[i].equals("profiling")) {
//System.err.println("Profiling job " + pbsJobStatus.getJobName());
                              return true; 
                           }
                        }
		}

		return false;

	}

}
